<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>充值</title>
  </head>
  <script type="text/javascript">
$("#button-save-dialog").click(function() {
	var	password = $("input#password").val(),
		confirmPassword = $("input#confirmPassword").val(),
		result = "";
	if (password == null || password.length < 6){
		alertMsg.error('密码不能小于6位');
		return;		
	}else if (password != confirmPassword){
		result = '两次输入密码不一致';
		alertMsg.error('两次输入密码不一致');
		return;
	}
	change(password);
 });


$("#button-close-dialog").click(function() {
    $.pdialog.close("changePasswordDialog");
});


function change(password){
	$.ajax({
   		type: 'POST',
   		url: '<%=path%>/user/changePassword.action',
   		data: {"password" : password},
   		dataType: 'html',
   		error: function(){
	    	alertMsg.error('修改密码发生错误');
	    },
		success: function (data){
   			alertMsg.correct('修改密码成功');
   		}
    });
}	
  </script>
  
  
  <body>
<div class="pageContent">
						<div class="pageFormContent" layoutH="56">
							
							<p  id="moneyDiv">
									<label>输入密码：</label>
									<input id="password" name="password" value="" class="number require" type="text"/>
									<a style="margin-left:10px;margin-top:5px;" href="javascript:change('123456');" id="initpassord">初始化为123456</a>
							</p>
							<p  id="moneyDiv">
									<label>重新输入密码：</label>
									<input id="confirmPassword" name="confirmPassword" value="" class="number require" type="text"/>
							</p>
							
						</div>	
						 <div class="formBar">
							<ul>
								<li><div class="buttonActive"><div class="buttonContent"><button id="button-save-dialog">确定</button></div></div></li>
								<li>
									<div class="button"><div class="buttonContent"><button  id="button-close-dialog" type="button" class="close">关闭</button></div></div>
								</li>
							</ul>
						</div>
					
</div>
</body>
</html>
 
 
